﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Game.Facade;
using Game.Entity.NativeWeb;
using Game.Utils;

namespace Game.Web.Mobile
{
    public partial class Index : System.Web.UI.Page
    {
        // 客户端类型
        protected int terminalType = 0;

        protected string tel = string.Empty;
        protected string qq = string.Empty;

        protected string title = string.Empty;
        protected string platformDownloadUrl = string.Empty;

        protected void Page_Load(object sender, EventArgs e)
        {
            terminalType = Fetch.GetTerminalType(Page.Request);
            ConfigInfo ciAndroid = FacadeManage.aideNativeWebFacade.GetConfigInfo(AppConfig.SiteConfigKey.GameAndroidConfig.ToString());
            ConfigInfo ciIos = FacadeManage.aideNativeWebFacade.GetConfigInfo(AppConfig.SiteConfigKey.GameIosConfig.ToString());
            if (ciAndroid.Field1 != "" || ciIos.Field1 != "")
            {
                if (terminalType == 1)
                {
                    platformDownloadUrl = ciAndroid.Field1;
                }
                else
                {
                    platformDownloadUrl = ciIos.Field1;
                }
            }

            ConfigInfo config = FacadeManage.aideNativeWebFacade.GetConfigInfo(AppConfig.SiteConfigKey.ContactConfig.ToString());
            if(config != null)
            {
                qq = config.Field4;
                tel = config.Field1;
            }

            title = ApplicationSettings.Get("title");
        }
    }
}